package com.jzo2o.market.controller.consumer;

import com.jzo2o.market.model.dto.response.ActivityInfoResDTO;
import com.jzo2o.market.service.IActivityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/*
 *   Description MarketController
 *   @author zhangyan
 *   @time   2024/12/15
 */
@RestController("consumerActivityController")
@Api(tags = "优惠卷活动服务")
@Slf4j
@RequestMapping("/consumer/activity")
public class ConsumerActivityController {
    @Autowired
    private IActivityService activityService;


    @GetMapping("/list")
    @ApiOperation("用户端抢券列表分页接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "tabType", value = "页面tab类型，1：疯抢中，2：即将开始", required = true, dataTypeClass = Integer.class)})
    public List<ActivityInfoResDTO> queryForPage(@RequestParam(value = "tabType",required = true) Integer tabType) {
        return activityService.queryForPage(tabType);
    }
}
